<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<script type="text/javascript"
	src='<c:url value="/resources/js/jquery-ui-1.8.16.custom.min.js"/>'></script>
<link rel="stylesheet"
	href='<c:url value="/resources/css/redmond/jquery-ui-1.8.16.custom.css"/>' />
<script type="text/javascript"
	src='<c:url value="/resources/js/jquery.ui.datepicker-zh-CN.js"/>'></script>
<script type="text/javascript"
	src='<c:url value="/resources/js/jquery-ui-timepicker-addon.js"/>'></script>
<script type="text/javascript"
	src='<c:url value="/resources/js/members/search.js"/>'></script>


<form:form modelAttribute="member" id="memberForm">
	<form:hidden path="pageIndex" id="pageIndex" value="1" />
	<fieldset>
		<legend>会员查询</legend>

		<table class="nostyle">
			<tbody>
				<tr>
					<td><label>银行卡号: </label></td>
					<td><input type="text" name="memberCardNumber" /></td>
					<td><label>会员姓名:</label></td>
					<td><input type="text" name="name" /></td>
					<td><label>联系电话:</label></td>
					<td><input type="text" name="phoneNumber" /></td>
				</tr>
				<tr>
					<td><label>身份证号码:</label></td>
					<td><input type="text" name="idCardNumber" /></td>
					<td><label>家庭地址:</label></td>
					<td><input type="text" name="address" /></td>
					<td><label>业务员:</label></td>
					<td><select name="operatorID">
							<option selected="selected" value="0">请选择</option>
							<c:forEach items="${operatorList }" var="operator">
								<option value="${operator.id }">${operator.id }
									${operator.name }</option>
							</c:forEach>
					</select></td>
				</tr>
				<tr>
					<td><label>购买产品:</label></td>
					<td><select name="goodsID">
							<option selected="selected" value="0">请选择</option>
							<c:forEach items="${goodsList }" var="goods">
								<option value="${goods.id }">${goods.id } ${goods.name
									}</option>
							</c:forEach>
					</select></td>
					<td><label>消费金额:</label></td>
					<td><input type="text" name="goodsPrice" value="" /></td>
					<td><label>返利金额:</label></td>
					<td><input type="text" name="profitReturnAmount" value="" /></td>
				</tr>
				<tr>
					<td><label>所属部门:</label></td>
					<td><select name="departmentID">
							<option selected="selected" value="0">请选择</option>
							<c:forEach items="${departmentList }" var="department">
								<option value="${department.id }">${department.id }
									${department.departmentName }</option>
							</c:forEach>
					</select></td>
					<td><label>建卡时间:</label></td>
					<th colspan="4"><input type="text" name="fromDate" id="from"
						readonly />-<input type="text" name="toDate" readonly id="to" /></th>
				</tr>
				<tr>
					<th colspan="5"><label></label></th>
					<td><input id="searchButton" type="button" value="查询" /></td>
				</tr>
			</tbody>
		</table>
	</fieldset>
</form:form>

<div id="searchResultDiv" title="查询结果"></div>
<div id="editDiv" title="会员编辑">
	<form:form modelAttribute="member" id="editMemberForm">
		<input type="hidden" name="id" id="id" />
		<fieldset>
			<table class="nostyle">
				<tbody>
					<tr>
						<td><label><font color="red">*</font>银行卡号:</label></td>
						<td><form:input path="memberCardNumber" id="memberCardNumber" /></td>
						<td><label><font color="red">*</font>身份证号码:</label></td>
						<td><form:input path="idCardNumber" id="idCardNumber"
								class="text-long" /></td>
					</tr>
					<tr>
						<td><label><font color="red">*</font>会员姓名:</label></td>
						<td><form:input path="name" id="memberName" class="text-long" /></td>
						<td><label><font color="red">*</font>联系电话:</label></td>
						<td><form:input path="phoneNumber" id="phoneNumber"
								class="text-long" /></td>
					</tr>
					<tr>
						<td><label>家庭地址:</label></td>
						<td><form:input path="address" id="address" class="text-long" /></td>
						<td><label><font color="red">*</font>业务员:</label></td>
						<td><select id="operatorID" name="operatorID">
								<c:forEach items="${operatorList }" var="operator">
									<option value="${operator.id }">${operator.id }
										${operator.name }</option>
								</c:forEach>
						</select></td>
					</tr>
					<tr>
						<td><label><font color="red">*</font>购买产品:</label></td>
						<td><select id="goodsID" name="goodsID">
								<c:forEach items="${goodsList }" var="goods">
									<option value="${goods.id }">${goods.id } ${goods.name
										}</option>
								</c:forEach>
						</select></td>
						<td><label><font color="red">*</font>消费金额:</label></td>
						<td><form:input path="goodsPrice" id="costAmount"
								class="text-long" /></td>
					</tr>
					<tr>
						<td><label><font color="red">*</font>返利比例(%):</label></td>
						<td><form:input path="profitReturnPercent" id="profitPercent"
								class="text-small" value="100" /><input type="button"
							id="calculateProfitAmount" value="计算返利"></td>
						<td><label><font color="red">*</font>返利金额(销售金额*返利比例):</label></td>
						<td><form:input path="profitReturnAmount" id="profitAmount"
								class="text-long" /></td>
					</tr>
					<tr>
						<td><label><font color="red">*</font>建卡时间:</label></td>
						<td><form:input id="createDate" path="createDateString"
								class="text-long" readonly="true" /></td>
						<td><label><font color="red">*</font>所属部门:</label></td>
						<td><select id="departmentID" name="departmentID">
								<c:forEach items="${departmentList }" var="department">
									<option value="${department.id }">编号:${department.id }
										名称:${department.departmentName }</option>
								</c:forEach>
						</select></td>
					</tr>
					<tr>
						<td><label>备注信息:</label></td>
						<th colspan="3"><form:textarea path="description"
								id="description" rows="4" cols="40" /></th>
					</tr>
				</tbody>
			</table>
		</fieldset>
	</form:form>
</div>